<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up()
    {
        /**
         * 景点api供应商
         */
        Schema::create('scenic_spot_providers', function (Blueprint $table) {
            $table->id();
            $table->string('scenic_id',32)->comment('景点id');
            $table->string('provider',16)->comment('供应商,这个阶段默认 tuniu , 如qunar,meituan,self..等');
            $table->string('provider_scenic_id',32)->comment('供应商景点id');
            $table->timestamps();
            $table->index(['scenic_id','provider'],'idx_spot_provider');
            $table->unique(['provider_scenic_id','provider'],'unique_provider_spot');
        });
    }

    public function down()
    {
        Schema::dropIfExists('scenic_spot_providers');
    }
};
